home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 2000 #5
/
Amiga Plus CD - 2000 - No. 5.iso
/
Tools
/
Dev
/
GameboyDev
/
GBDK
/
lib
/
ltoa.c
< prev
next >
Wrap
C/C++ Source or Header
|
1999-03-29
|
271b
|
22 lines
#include <stdlib.h>
char *ltoa(WORD n, char *s)
{
UBYTE i, sign;
if(n < 0) {
sign = 1;
n = -n;
} else
sign = 0;
i = 0;
do {
s[i++] = n % 10 + '0';
} while((n = n/10) > 0);
if(sign)
s[i++] = '-';
s[i] = 0;
reverse(s);
return s;
}